package com.gnerv.sylvanas.framework.plugin.logger.appender;

import ch.qos.logback.classic.AsyncAppender;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
import ch.qos.logback.classic.filter.LevelFilter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy;
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
import lombok.Data;

/**
 * @author Gnerv LiGen
 */
@Data
public class ElasticsearchAppender {

    private TimeBasedRollingPolicy<ILoggingEvent> timeBasedRollingPolicy;
    private PatternLayoutEncoder patternLayoutEncoder;
    private LevelFilter levelFilter;
    private AsyncAppender asyncAppender;

    private static TimeBasedRollingPolicy<ILoggingEvent> getTimeBasedRollingPolicy() {
        SizeAndTimeBasedRollingPolicy<ILoggingEvent> objectSizeAndTimeBasedRollingPolicy = new SizeAndTimeBasedRollingPolicy<>();
        return objectSizeAndTimeBasedRollingPolicy;
    }

    public AsyncAppender getAsyncAppender() {
        return asyncAppender;
    }
}
